Skip to content

Implement dynamic versioning with axion-release plugin#37

Open
Xitee1 wants to merge 2 commits into
mainfrom
claude/add-git-versioning-oVR2h
Open

Implement dynamic versioning with axion-release plugin#37
Xitee1 wants to merge 2 commits into
mainfrom
claude/add-git-versioning-oVR2h

Conversation

@Xitee1
Copy link
Copy Markdown
Owner

@Xitee1 Xitee1 commented Apr 27, 2026

Summary

Migrate from manual version management to dynamic versioning using the axion-release plugin. This automates version derivation from git tags and commit history, eliminating the need to manually update version codes and names.

Key Changes

  • Root build configuration: Added axion-release plugin with git tag prefix v and configured all projects to use the resolved SCM version
  • App versioning:
    • versionCode now dynamically set to git commit count via git rev-list --count HEAD
    • versionName now derived from project.version (latest v* git tag)
    • Removed hardcoded version schema and manual version fields
  • CI/CD workflows: Updated both ci.yml and release.yml to fetch full git history and tags (fetch-depth: 0, fetch-tags: true) so axion-release can access version information
  • Documentation: Updated AGENTS.md to reflect the new dynamic versioning approach and release process (push v<x.y.z> tags to trigger releases)
  • Dependencies: Added axion-release plugin v1.18.16 to gradle/libs.versions.toml

Implementation Details

  • Version code is calculated at build time using git command execution via Gradle providers
  • The SCM version is resolved once at root level and propagated to all subprojects
  • Git checkout depth must be 0 in CI to ensure full history and tags are available for version resolution
  • Release workflow remains unchanged; pushing a v* tag automatically triggers the build and GitHub Release publication

https://claude.ai/code/session_01PSrWgqkFDtqBGuV78dbeci

claude added 2 commits April 27, 2026 11:46
versionName now comes from the latest v* git tag (project.version)
and versionCode is the git rev-list --count HEAD commit count.
CI checkouts use fetch-depth: 0 so tags and full history are visible
to both axion-release and rev-list.
Reads cleaner than capturing the version into a local val first;
both forms resolve the extension on the root project.
@Xitee1 Xitee1 marked this pull request as ready for review April 27, 2026 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants